<?php

require_once( 'kebcore.php' );
require_once( 'core/output.php' );


function testtest()
{
	Log::info( "super!" );
}

function printBacktrace()
{
	Log::backtrace();
}

class Toto
{
	function testtest()
	{
		Log::error( "bordel!" );
	}
}

$t = new Toto();

Log::debug( "bonjour" );
testtest();
$t->testtest();
Log::fatal( "fatal here!" );
printBacktrace();
//Log::death( "DEAD!" );

Output::go();

//function backtrace( $txt )
//{
//	print( "<h2> $txt </h2>\n" );
//	$bt = debug_backtrace( $provide_object=false );
//	//print_r( $bt );
//
//	$record = array( 'class'=>null, 'mth'=>null, 'file'=>null, 'line'=>null );
//	$out = array();
//	$i = 0;
//	$count = sizeof($bt);
//	while( $count-- )
//	{
//		$b =& $bt[$count];
//		//if( $b['function'] == 'backtrace' ) break;
//
//		// we keep the previous file and line in case it's missing
//		$record['class'] = (isset($b['class'])) ? $b['class'] : '';
//		$record['mth'] = (isset($b['function'])) ? $b['function'] : '';
//		if( isset($b['file']) ) $record['file'] = $b['file'];
//		if( isset($b['line']) ) $record['line'] = $b['line'];
//
//		$out[$i++] = $record;
//	}
//
//	print_r($out);
//	return $out;
//}
//
//backtrace( "in main()" );
//
//function testA()
//{
//	backtrace( "within testA()" );
//}
//
//class Toto
//{
//	public function testB()
//	{
//		backtrace( "within Toto::testB()" );
//	}
//};
//
//testA();
//
//$t = new Toto();
//$t->testB();
//
//function call_user( $t )
//{
//	print( "<br><br>using call_user_func_array<br>\n" );
//	call_user_func_array( array($t, "testB"), array() );
//}
//
//call_user( $t );
?>
